package org.nanotek;


@SuppressWarnings("serial")
public abstract class AbstractBase<K extends Base<?>> implements Base<K> {

	protected K k;

	@Override
	public K getId() {
		return k;
	}

	@Override
	public void setId(K id) {
		this.k = id; 
	}
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((k == null) ? 0 : k.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		AbstractBase other = (AbstractBase) obj;
		if (k == null) {
			if (other.k != null)
				return false;
		} else if (!k.equals(other.k))
			return false;
		return true;
	}

}
